<template>
	<view>
		<view>
			<uni-nav-bar shadow left-icon="left" dark title="比价单查询" @clickLeft="back()"/>
		</view>
		<view>
			<uni-row >
				<uni-col :span="24"><uni-easyinput class="uni-mt-5" suffixIcon="search" v-model="orderCompareForm.compareNum"  placeholder="比价单号" @iconClick="iconClick"></uni-easyinput></uni-col>
				<!-- <uni-col :span="12"><uni-easyinput class="uni-mt-5" suffixIcon="search"  placeholder="物料编码" @iconClick="iconClick"></uni-easyinput></uni-col> -->
			</uni-row>
				<view v-for="(item,index) in form" :key="index">
					<uni-card>
						<uni-row><text style="font-weight: 600;">创建日期:</text>{{item.createdDate}}</uni-row>
					    <uni-row><text style="font-weight: 600;">比价单号:</text>{{item.compareNum}}</uni-row>
					    <uni-row><text style="font-weight: 600;">物料总数:</text>{{item.itemQuantity}}</uni-row>
						<uni-row><text style="font-weight: 600;">状态:</text>{{item.statusName}}</uni-row>
						<uni-row style="text-align: center;"><button size="mini" type="primary" @click="inquiry_review_list_detail(form[index])">详情查看</button></uni-row>
					</uni-card>
				</view>
			
	
		
			
			
			
		</view>
		
	</view>
</template>

<script>
	import {OrderCompareFormDatatable} from "@/api/system/user"
	export default {
		data() {
			return {
				form:null,
				orderCompareForm:{
					page: 1,
					rows: 100,
					compareNum:null,
				}
			}
		},
		onLoad() {
			this.get()
		},
		methods: {
			iconClick(){
			  this.get()	
			},
			get(){
			OrderCompareFormDatatable(this.orderCompareForm).then(res=>{
				this.form = res.rows
			})	
			},
			
			back(){
					this.$tab.reLaunch('/pages/work/purchaser/index')
			},
			inquiry_review_list_detail(e){
				 
				uni.navigateTo({
				       url: '/pages/work/purchaser/inquiry_review_list_detail',
				       success: (respost) => {
				           // 通过eventChannel向被打开页面传送数据
				           respost.eventChannel.emit('acceptDataFromOpenerPage', {data:e},
						   )}
				     });

			}
		}
	}
</script>

<style>

</style>
